import { visualConfig } from '@editor/editor.config'

let componentMap = visualConfig.componentMap;
export default ({
    name: 'Block',
    props: {
        element: {
            type: Object,
            default: () => ({})
        }
    },
    render(h) {
        const {
            componentKey,
            styles = {},
            props = {},
        } = this.element;
        console.log(props, 'props')
        return componentMap[componentKey].render(h, { props, styles, block: this.element, slots: this.$scopedSlots })
    }
})
